
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>docker配置 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="docker常用命令.html" />
    
    
    <link rel="prev" href="docker卸载.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../SUMMARY.html">
            
                <a href="../SUMMARY.html">
            
                    
                    工具
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="SUMMARY.html">
            
                <a href="SUMMARY.html">
            
                    
                    docker
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1.1" data-path="./">
            
                <a href="./">
            
                    
                    docker简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.2" data-path="docker安装_centOS方式.html">
            
                <a href="docker安装_centOS方式.html">
            
                    
                    docker安装_centOS方式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.3" data-path="docker升级_centOS方式.html">
            
                <a href="docker升级_centOS方式.html">
            
                    
                    docker升级_centOS方式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.4" data-path="docker卸载.html">
            
                <a href="docker卸载.html">
            
                    
                    docker卸载
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2.1.5" data-path="docker配置.html">
            
                <a href="docker配置.html">
            
                    
                    docker配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.6" data-path="docker常用命令.html">
            
                <a href="docker常用命令.html">
            
                    
                    docker常用命令
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >docker配置</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
                                <section class="normal markdown-section">
                                
                                <h1 id="docker&#x914D;&#x7F6E;">docker&#x914D;&#x7F6E;</h1>
<ol>
<li><p><strong>&#x9ED8;&#x8BA4;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4F4D;&#x7F6E;</strong></p>
<blockquote>
<p>/usr/lib/systemd/system  </p>
</blockquote>
<p> &#x5982;&#x679C;&#x4E0D;&#x6E05;&#x695A;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x547D;&#x4EE4;</p>
<pre><code class="lang-shell"> systemctl disable docker
 &#x6216;
 systemctl enable docker
</code></pre>
<p> &#x91CD;&#x6784;docker&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x7684;&#x8F6F;&#x8FDE;&#x63A5;&#x7136;&#x540E;&#x4FEE;&#x6539;</p>
<p> &#x4FEE;&#x6539;&#x5B8C;&#x6210;&#x540E;&#x91CD;&#x65B0;&#x542F;&#x52A8;docker</p>
<pre><code class="lang-shell"> systemctl daemon-reload
 systemctl start docker
</code></pre>
<h2 id="&#x4F46;&#x662F;&#x5DF2;&#x7ECF;&#x4E0D;&#x63A8;&#x8350;&#x76F4;&#x63A5;&#x4FEE;&#x6539;&#x914D;&#x7F6E;&#x6587;&#x4EF6;">&#x4F46;&#x662F;&#x5DF2;&#x7ECF;&#x4E0D;&#x63A8;&#x8350;&#x76F4;&#x63A5;&#x4FEE;&#x6539;&#x914D;&#x7F6E;&#x6587;&#x4EF6;</h2>
<p> <br></p>
</li>
<li><p><strong>&#x4F7F;&#x7528;&#x5916;&#x7F6E;&#x914D;&#x7F6E;&#x6587;&#x4EF6;</strong></p>
<p> &#x7528;&#x547D;&#x4EE4;&#x67E5;&#x770B;(&#x627E;&#x5230; --config-file )</p>
<pre><code class="lang-shell"> man dockerd
</code></pre>
<p> &#x4E00;&#x822C;&#x9ED8;&#x8BA4;&#x5728; (&#x6CA1;&#x6709;&#x5C31;&#x624B;&#x52A8;&#x521B;&#x5EFA;)</p>
<blockquote>
<p>/etc/docker/daemon.json</p>
</blockquote>
<p> <br></p>
</li>
<li><p>daemon.json &#x914D;&#x7F6E;&#x8BE6;&#x60C5;
 daemon.json &#x548C;&#x4F7F;&#x7528;docker &#x547D;&#x4EE4;&#x884C;&#x53C2;&#x6570;&#x542F;&#x52A8;&#x5E76;&#x65E0;&#x533A;&#x522B; (json&#x6587;&#x4EF6;&#x4E0D;&#x7528;&#x6BCF;&#x6B21;&#x90FD;&#x8F93;&#x5165;)
 &#x5B98;&#x7F51;&#x89E3;&#x91CA;</p>
<blockquote>
<p>To run the daemon with debug output, use <code>dockerd -D</code> or add <code>&quot;debug&quot;: true</code> to
the <code>daemon.json</code> file.</p>
<p>&#x5982;&#x679C;&#x8981;&#x542F;&#x52A8;debug&#x6A21;&#x5F0F;&#x8F93;&#x51FA;&#x8FD0;&#x884C;, &#x8BF7;&#x4F7F;&#x7528;  <strong>dockerd-d</strong> &#x6216;&#x8005;&#x5C06; <strong>&quot;debug&quot;: true</strong> &#x52A0;&#x5165;&#x5230;daemon.json</p>
</blockquote>
<p> &#x6240;&#x4EE5;&#x8981;&#x4FEE;&#x6539;&#x4EC0;&#x4E48;&#x53EF;&#x4EE5;&#x67E5;&#x770B;&#x4E0B;&#x9762;&#x547D;&#x4EE4;&#x7136;&#x540E;&#x6DFB;&#x52A0;&#x5230;daemon.json&#x4E2D;
 &#x4FEE;&#x6539;&#x5B8C;&#x6210;&#x540E;&#x4E5F;&#x8981;&#x91CD;&#x65B0;&#x542F;&#x52A8;docker</p>
<pre><code class="lang-shell"> systemctl restart docker.service
</code></pre>
<p> <br></p>
</li>
<li><p>dockins&#x547D;&#x4EE4;&#x8BE6;&#x89E3;
 <a href="https://docs.docker.com/engine/reference/commandline/dockerd/#daemon" target="_blank">docker&#x8BE6;&#x7EC6;&#x53C2;&#x6570;</a></p>
</li>
</ol>
<blockquote>
<p>Options:
--add-runtime runtime                           Register an additional OCI compatible runtime (default [])
--allow-nondistributable-artifacts list     Push nondistributable artifacts to specified registries (default [])
--api-cors-header string                            Set CORS headers in the Engine API
--authorization-plugin list                           Authorization plugins to load (default [])
--bip string                                         Specify network bridge IP
-b, --bridge string                                   Attach containers to a network bridge
--cgroup-parent string                           Set parent cgroup for all containers
--cluster-advertise string                       Address or interface name to advertise
--cluster-store string                          URL of the distributed storage backend
--cluster-store-opt map                      Set cluster store options (default map[])
--config-file string                              Daemon configuration file (default &quot;/etc/docker/daemon.json&quot;)
--containerd string                             Path to containerd socket
--cpu-rt-period int                              Limit the CPU real-time period in microseconds
--cpu-rt-runtime int                            Limit the CPU real-time runtime in microseconds
--data-root string                               Root directory of persistent Docker state (default &quot;/var/lib/docker&quot;)
-D, --debug                                        Enable debug mode
--default-gateway ip                          Container default gateway IPv4 address
--default-gateway-v6 ip                     Container default gateway IPv6 address
--default-address-pool                       Set the default address pool for local node networks
--default-runtime string                      Default OCI runtime for containers (default &quot;runc&quot;)
--default-ulimit ulimit                          Default ulimits for containers (default [])
--dns list                                        DNS server to use (default [])
--dns-opt list                                      DNS options to use (default [])
--dns-search list                                DNS search domains to use (default [])
--exec-opt list                                     Runtime execution options (default [])
--exec-root string                               Root directory for execution state files (default &quot;/var/run/docker&quot;)
--experimental                                   Enable experimental features
--fixed-cidr string                               IPv4 subnet for fixed IPs
--fixed-cidr-v6 string                          IPv6 subnet for fixed IPs
-G, --group string                                       Group for the unix socket (default &quot;docker&quot;)
--help                                                Print usage
-H, --host list                                      Daemon socket(s) to connect to (default [])
--icc                                                   Enable inter-container communication (default true)
--init                                              Run an init in the container to forward signals and reap processes
--init-path string                                Path to the docker-init binary
--insecure-registry list                           Enable insecure registry communication (default [])
--ip ip                                             Default IP when binding container ports (default 0.0.0.0)
--ip-forward                                           Enable net.ipv4.ip_forward (default true)
--ip-masq                                           Enable IP masquerading (default true)
--iptables                                               Enable addition of iptables rules (default true)
--ipv6                                              Enable IPv6 networking
--label list                            Set key=value labels to the daemon (default [])
--live-restore                          Enable live restore of docker when containers are still running
--log-driver string                     Default driver for container logs (default &quot;json-file&quot;)
-l, --log-level string                      Set the logging level (&quot;debug&quot;, &quot;info&quot;, &quot;warn&quot;, &quot;error&quot;, &quot;fatal&quot;) (default &quot;info&quot;)
--log-opt map                           Default log driver options for containers (default map[])
--max-concurrent-downloads int          Set the max concurrent downloads for each pull (default 3)
--max-concurrent-uploads int            Set the max concurrent uploads for each push (default 5)
--metrics-addr string                   Set default address and port to serve the metrics api on
--mtu int                               Set the containers network MTU
--node-generic-resources list           Advertise user-defined resource
--no-new-privileges                     Set no-new-privileges by default for new containers
--oom-score-adjust int                  Set the oom_score_adj for the daemon (default -500)
-p, --pidfile string                        Path to use for daemon PID file (default &quot;/var/run/docker.pid&quot;)
--raw-logs                              Full timestamps without ANSI coloring
--registry-mirror list                  Preferred Docker registry mirror (default [])
--seccomp-profile string                Path to seccomp profile
--selinux-enabled                       Enable selinux support
--shutdown-timeout int                  Set the default shutdown timeout (default 15)
-s, --storage-driver string                 Storage driver to use
--storage-opt list                      Storage driver options (default [])
--swarm-default-advertise-addr string   Set default address or interface for swarm advertised address
--tls                                   Use TLS; implied by --tlsverify
--tlscacert string                      Trust certs signed only by this CA (default &quot;~/.docker/ca.pem&quot;)
--tlscert string                        Path to TLS certificate file (default &quot;~/.docker/cert.pem&quot;)
--tlskey string                         Path to TLS key file (default ~/.docker/key.pem&quot;)
--tlsverify                             Use TLS and verify the remote
--userland-proxy                        Use userland proxy for loopback traffic (default true)
--userland-proxy-path string            Path to the userland proxy binary
--userns-remap string                   User/Group setting for user namespaces
-v, --version        </p>
</blockquote>

                                
                                </section>
                            
                        </div>
                    </div>
                
            </div>

            
                
                <a href="docker卸载.html" class="navigation navigation-prev " aria-label="Previous page: docker卸载">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="docker常用命令.html" class="navigation navigation-next " aria-label="Next page: docker常用命令">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"docker配置","level":"1.2.1.5","depth":3,"next":{"title":"docker常用命令","level":"1.2.1.6","depth":3,"path":"工具/docker/docker常用命令.md","ref":"工具/docker/docker常用命令.md","articles":[]},"previous":{"title":"docker卸载","level":"1.2.1.4","depth":3,"path":"工具/docker/docker卸载.md","ref":"工具/docker/docker卸载.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["expandable-chapters-small","livereload"],"pluginsConfig":{"expandable-chapters-small":{},"livereload":{},"highlight":{},"search":{"maxIndexSize":1000000},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"工具/docker/docker配置.md","mtime":"2019-03-19T14:01:54.405Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-03-19T13:58:49.999Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/buttons.js"></script>
        
    

    </body>
</html>

